<?php


namespace App\Http\Controllers\Api;


use App\Http\Controllers\Controller;
use App\Models\Feedback;
use Illuminate\Http\Request;

class FeedbackController extends Controller
{

    public function setFeedback(Request $request){
        $content = $request->get('content');
        $fileList = $request->get('fileList');
        $data['user_id'] = $this->uId;
        $data['title'] = $this->user['mobile'];
        $data['desc'] = $content;
        $data['fileList'] = $fileList;
        //dd($data);
        $result = Feedback::where(['status'=>0,'user_id'=>$this->uId])->count();
        if($result < 4){
            Feedback::create($data);
            return showMsg('提交成功', 200);
        }else{
            return showMsg('感谢您的意见或建议！', 201);
        }
    }

}